package org.dromara.batch;

import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.scope.context.ChunkContext;
import org.springframework.batch.core.step.tasklet.Tasklet;
import org.springframework.batch.repeat.RepeatStatus;

// 挂单任务
public class PlaceOrderTasklet implements Tasklet {
    private TradingService tradingService;

    public PlaceOrderTasklet(TradingService tradingService) {
        this.tradingService = tradingService;
    }

    @Override
    public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
        tradingService.placeOrder();
        return RepeatStatus.FINISHED;
    }
}